<?php

namespace app\validate;

use think\Validate;

class BannerValidate extends Validate
{
    protected $rule = [
        'title' => 'require|max:255',
        'type' => 'require|in:1,2',
        'file_url' => 'require|url',
        'jump_type' => 'require|in:0,1,2',
        'jump_url' => 'require',
        'sort' => 'number',
        'is_show' => 'in:0,1',
    ];

    protected $message = [
        'title.require' => '标题不能为空',
        'type.in' => '类型参数错误',
        'jump_type.in' => '跳转类型参数错误',
        'jump_url.requireIf' => '跳转地址不能为空',
    ];

}